home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / Xm / SgSpringBox.z / SgSpringBox
Text File  |  1998-10-30  |  22KB  |  397 lines

  1.  
  2.  
  3.  
  4.      SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))           UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV           SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx - The SgSpringBox widget class
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           ####iiiinnnncccclllluuuuddddeeee <<<<SSSSggggmmmm////SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx....hhhh>>>>
  13.  
  14.  
  15.      VVVVEEEERRRRSSSSIIIIOOOONNNN
  16.           This page documents the version of Sgm that accompanies
  17.           Motif 2.1.
  18.  
  19.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  20.           SgSpringBox is a container widget with no input semantics of
  21.           its own. It arranges its children in a single row or column
  22.           based on a set of spring constraints assigned to each child.
  23.           The SgSpringBox widget allows layouts similar to those
  24.           supported by the XmForm widget, but are usually easier to
  25.           set up. It is also possible to create some layouts that
  26.           cannot be achieved with the XmForm widget. For example,
  27.           centering a column of widgets is very easy to do with the
  28.           SgSpringBox widget, but nearly impossible using the XmForm.
  29.  
  30.           Each child of an SgSpringBox widget has 6 constraints
  31.           associated with it.  First, each child has a "springyness"
  32.           in both the vertical and horizontal direction that
  33.           determines how much the child may be resized in each
  34.           direction.
  35.  
  36.           The resources XmNverticalSpring and XmNhorizontalSpring
  37.           control the degree of "springyness" in each child. A value
  38.           of zero means the child cannot be resized in that direction.
  39.           For non-zero values, the values are compared to the values
  40.           of other springs in the overall system to determine the
  41.           proportional effects of any resizing. The default value of
  42.           both resources is zero.
  43.  
  44.           Each child also has a spring between its left, right, top,
  45.           and bottom sides and whatever boundary it is adjacent to. By
  46.           default, the value of each of these springs is 50. A value
  47.           of zero means that the SgSpringBox widget cannot add
  48.           additional space adjacent to that part of a widget. Larger
  49.           values are considered in relation to all other spring values
  50.           in the system.
  51.  
  52.           The behavior of the widget is best seen by example. The
  53.           following code places two widget in a single column. With
  54.           the default resource settings, this results in both chidlren
  55.           being centered in the parent, one above the other.
  56.  
  57.           void createCenteredWidgets(Widget parent)
  58.            {
  59.                Arg args[2];
  60.  
  61.  
  62.  
  63.      Page 1                                         (printed 10/24/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))           UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV           SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))
  71.  
  72.  
  73.  
  74.                Widget springbox, child1, child2;
  75.  
  76.                XtSetArg(args[0], XmNorientation, XmVERTICAL);
  77.                springbox   = SgCreateSpringBox( parent, "column",
  78.           args, 1 );
  79.  
  80.                child1 =  XmCreatePushButton ( box, "child1", NULL, 0
  81.           );
  82.                child2 =  XmCreatePushButton ( box, "child2", NULL, 0
  83.           );
  84.  
  85.                XtManageChild(child1);
  86.                XtManageChild(child2);
  87.                XtManageChild(springbox);
  88.            }
  89.  
  90.  
  91.           This example creates two widgets in a horizontal row. As the
  92.           row is resized, the widget gravitates to the left and right
  93.           sides of the row. The leftmost child also hangs from the top
  94.           of its parent, while the rightmost widget gravitates to the
  95.           bottom of its parent.
  96.  
  97.           void createCenteredWidgets(Widget parent) {
  98.              Arg args[5];
  99.              int n;
  100.              Widget springbox, child1, child2;
  101.  
  102.              n = 0;
  103.              XtSetArg(args[n], XmNorientation, XmCOLUMN);n++
  104.              springbox   = SgCreateSpringBox( parent, "column", args,
  105.           1 );
  106.  
  107.              n = 0;
  108.              XtSetArg(args[n], XmNrightSpring,  0);n++
  109.              XtSetArg(args[n], XmNleftSpring,   100);n++
  110.              XtSetArg(args[n], XmNbottomSpring,   0);n++
  111.              XtSetArg(args[n], XmNtopSpring,    100);n++
  112.              child1 =  XmCreatePushButton ( box, "child1", args, n);
  113.  
  114.              n = 0;
  115.              XtSetArg(args[n], XmNrightSpring,  100);n++
  116.              XtSetArg(args[n], XmNleftSpring,     0);n++
  117.              XtSetArg(args[n], XmNbottomSpring, 100);n++
  118.              XtSetArg(args[n], XmNtopSpring,      0);n++
  119.              child2 =  XmCreatePushButton ( box, "child2", args, n);
  120.  
  121.              XtManageChild(child1);
  122.              XtManageChild(child2);
  123.              XtManageChild(springbox); }
  124.  
  125.           Following are some important considerations in using a
  126.  
  127.  
  128.  
  129.      Page 2                                         (printed 10/24/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))           UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV           SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))
  137.  
  138.  
  139.  
  140.           SgSpringBox:
  141.  
  142.                Unmapping a child has no effect on the SgSpringBox
  143.                except that the child is not mapped.
  144.  
  145.      CCCCllllaaaasssssssseeeessss
  146.           SgSpringBox inherits behavior and resources from CCCCoooorrrreeee,
  147.           CCCCoooommmmppppoooossssiiiitttteeee, CCCCoooonnnnssssttttrrrraaaaiiiinnnntttt, XXXXmmmmMMMMaaaannnnaaaaggggeeeerrrr, and XXXXmmmmBBBBuuuulllllllleeeettttiiiinnnnBBBBooooaaaarrrrdddd
  148.           classes.
  149.  
  150.           The class pointer is SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxxWWWWiiiiddddggggeeeettttCCCCllllaaaassssssss.
  151.  
  152.           The class name is SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx.
  153.  
  154.      NNNNeeeewwww RRRReeeessssoooouuuurrrrcccceeeessss
  155.           The following table defines a set of widget resources used
  156.           by the programmer to specify data.  The programmer can also
  157.           set the resource values for the inherited classes to set
  158.           attributes for this widget.  To reference a resource by name
  159.           or by class in a .Xdefaults file, remove the XXXXmmmmNNNN or XXXXmmmmCCCC
  160.           prefix and use the remaining letters.  To specify one of the
  161.           defined values for a resource in a .Xdefaults file, remove
  162.           the XXXXmmmm prefix and use the remaining letters (in either
  163.           lowercase or uppercase, but include any underscores between
  164.           words).  The codes in the access column indicate if the
  165.           given resource can be set at creation time (C), set by using
  166.           XXXXttttSSSSeeeettttVVVVaaaalllluuuueeeessss (S), retrieved by using XXXXttttGGGGeeeettttVVVVaaaalllluuuueeeessss (G), or is
  167.           not applicable (N/A).
  168.  
  169.                             SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx RRRReeeessssoooouuuurrrrcccceeee SSSSeeeetttt
  170.          NNNNaaaammmmeeee             CCCCllllaaaassssssss            TTTTyyyyppppeeee   DDDDeeeeffffaaaauuuulllltttt        AAAAcccccccceeeessssssss
  171.          ______________________________________________________________
  172.          XmNorientation   XmCOrientation   int    XmHORIZONTAL   CG
  173.  
  174.                       SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx CCCCoooonnnnssssttttrrrraaaaiiiinnnntttt RRRReeeessssoooouuuurrrrcccceeee SSSSeeeetttt
  175.            NNNNaaaammmmeeee                  CCCCllllaaaassssssss       TTTTyyyyppppeeee   DDDDeeeeffffaaaauuuulllltttt   AAAAcccccccceeeessssssss
  176.            _________________________________________________________
  177.            XmNleftSpring         XmCSpring   int    50        CSG
  178.            XmNrightSpring        XmCSpring   int    50        CSG
  179.            XmNtopSpring          XmCSpring   int    50        CSG
  180.            XmNbottomSpring       XmCSpring   int    50        CSG
  181.            XmNverticalSpring     XmCSpring   int    0         CSG
  182.            XmNhorizontalSpring   XmCSpring   int    0         CSG
  183.  
  184.         XXXXmmmmNNNNlllleeeeffffttttSSSSpppprrrriiiinnnngggg
  185.                Determines the stretchability of the space adjacent to
  186.                the left side of the widget. The larger the value, the
  187.                more this space can be resized relative to other
  188.                "springs" contained in the SgSpringBox widget.
  189.  
  190.         XXXXmmmmNNNNrrrriiiigggghhhhttttSSSSpppprrrriiiinnnngggg
  191.           Determines the stretchability of the space adjacent to the
  192.  
  193.  
  194.  
  195.      Page 3                                         (printed 10/24/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))           UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV           SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))
  203.  
  204.  
  205.  
  206.           right side of the widget. The larger the value, the more
  207.           this space can be resized relative to other "springs"
  208.           contained in the SgSpringBox widget.
  209.  
  210.         XXXXmmmmNNNNttttooooppppSSSSpppprrrriiiinnnngggg
  211.           Determines the stretchability of the space adjacent to the
  212.           top side of the widget. The larger the value, the more this
  213.           space can be resized relative to other "springs" contained
  214.           in the SgSpringBox widget.
  215.  
  216.         XXXXmmmmNNNNbbbboooottttttttoooommmmSSSSpppprrrriiiinnnngggg
  217.           Determines the stretchability of the space adjacent to the
  218.           bottom side of the widget. The larger the value, the more
  219.           this space can be resized relative to other "springs"
  220.           contained in the SgSpringBox widget.
  221.  
  222.         XXXXmmmmNNNNvvvveeeerrrrttttiiiiccccaaaallllSSSSpppprrrriiiinnnngggg
  223.           Determines the stretchability of the widget in the vertical
  224.           direction.  The larger the value, the more this space can be
  225.           resized relative to other "springs" contained in the
  226.           SgSpringBox widget.
  227.  
  228.         XXXXmmmmNNNNhhhhoooorrrriiiizzzzoooonnnnttttaaaallllSSSSpppprrrriiiinnnngggg
  229.           Determines the stretchability of the widget in the
  230.           horizontal direction.  The larger the value, the more this
  231.           space can be resized relative to other "springs" contained
  232.           in the  SgSpringBox widget.
  233.  
  234.      IIIInnnnhhhheeeerrrriiiitttteeeedddd RRRReeeessssoooouuuurrrrcccceeeessss
  235.           SgSpringBox inherits behavior and resources from the
  236.           following superclasses.  For a complete description of each
  237.           resource, refer to the man page for that superclass.
  238.  
  239.                                XXXXmmmmBBBBuuuulllllllleeeettttiiiinnnnBBBBooooaaaarrrrdddd RRRReeeessssoooouuuurrrrcccceeee SSSSeeeetttt
  240.      NNNNaaaammmmeeee                  CCCCllllaaaassssssss                TTTTyyyyppppeeee             DDDDeeeeffffaaaauuuulllltttt        AAAAcccccccceeeessssssss
  241.      _________________________________________________________________________________
  242.      XmNallowOverlap       XmCAllowOverlap      Boolean          True           CSG
  243.      XmNautoUnmanage       XmCAutoUnmanage      Boolean          True           CG
  244.      XmNbuttonFontList     XmCButtonFontList    XmFontList       dynamic        CSG
  245.      XmNcancelButton       XmCWidget            Widget           NULL           SG
  246.      XmNdefaultButton      XmCWidget            Widget           NULL           SG
  247.      XmNdefaultPosition    XmCDefaultPosition   Boolean          True           CSG
  248.      XmNdialogStyle        XmCDialogStyle       unsigned char    dynamic        CSG
  249.      XmNdialogTitle        XmCDialogTitle       XmString         NULL           CSG
  250.      XmNfocusCallback      XmCCallback          XtCallbackList   NULL           C
  251.      XmNlabelFontList      XmCLabelFontList     XmFontList       dynamic        CSG
  252.      XmNmapCallback        XmCCallback          XtCallbackList   NULL           C
  253.      XmNmarginHeight       XmCMarginHeight      Dimension        0              CSG
  254.      XmNmarginWidth        XmCMarginWidth       Dimension        0              CSG
  255.      XmNnoResize           XmCNoResize          Boolean          False          CSG
  256.  
  257.  
  258.  
  259.  
  260.  
  261.      Page 4                                         (printed 10/24/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))           UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV           SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))
  269.  
  270.  
  271.  
  272.      XmNresizePolicy       XmCResizePolicy      unsigned char    XmRESIZE_ANY   CSG
  273.      XmNshadowType         XmCShadowType        unsigned char    XmSHADOW_OUT   CSG
  274.      XmNtextFontList       XmCTextFontList      XmFontList       dynamic        CSG
  275.      XmNtextTranslations   XmCTranslations      XtTranslations   NULL           C
  276.      XmNunmapCallback      XmCCallback          XtCallbackList   NULL           C
  277.  
  278.  
  279.                                              XXXXmmmmMMMMaaaannnnaaaaggggeeeerrrr RRRReeeessssoooouuuurrrrcccceeee SSSSeeeetttt
  280.      NNNNaaaammmmeeee                    CCCCllllaaaassssssss                         TTTTyyyyppppeeee                DDDDeeeeffffaaaauuuulllltttt                AAAAcccccccceeeessssssss
  281.      _______________________________________________________________________________________________________
  282.      XmNbottomShadowColor    XmCBottomShadowColor          Pixel               dynamic                CSG
  283.      XmNbottomShadowPixmap   XmCBottomShadowPixmap         Pixmap              XmUNSPECIFIED_PIXMAP   CSG
  284.      XmNforeground           XmCForeground                 Pixel               dynamic                CSG
  285.      XmNhelpCallback         XmCCallback                   XtCallbackList      NULL                   C
  286.      XmNhighlightColor       XmCHighlightColor             Pixel               dynamic                CSG
  287.      XmNhighlightPixmap      XmCHighlightPixmap            Pixmap              dynamic                CSG
  288.      XmNinitialFocus         XmCInitialFocus               Widget              dynamic                CSG
  289.      XmNnavigationType       XmCNavigationType             XmNavigationType    XmTAB_GROUP            CSG
  290.      XmNshadowThickness      XmCShadowThickness            Dimension           dynamic                CSG
  291.      XmNstringDirection      XmCStringDirection            XmStringDirection   dynamic                CG
  292.      XmNtopShadowColor       XmCBackgroundTopShadowColor   Pixel               dynamic                CSG
  293.      XmNtopShadowPixmap      XmCTopShadowPixmap            Pixmap              dynamic                CSG
  294.      XmNtraversalOn          XmCTraversalOn                Boolean             True                   CSG
  295.      XmNunitType             XmCUnitType                   unsigned char       dynamic                CSG
  296.      XmNuserData             XmCUserData                   Pointer             NULL                   CSG
  297.  
  298.  
  299.                              CCCCoooommmmppppoooossssiiiitttteeee RRRReeeessssoooouuuurrrrcccceeee SSSSeeeetttt
  300.      NNNNaaaammmmeeee                CCCCllllaaaassssssss               TTTTyyyyppppeeee          DDDDeeeeffffaaaauuuulllltttt   AAAAcccccccceeeessssssss
  301.      ______________________________________________________________________
  302.      XmNchildren         XmCReadOnly         WidgetList    NULL      G
  303.      XmNinsertPosition   XmCInsertPosition   XtOrderProc   NULL      CSG
  304.      XmNnumChildren      XmCReadOnly         Cardinal      0         G
  305.  
  306.  
  307.                                                    CCCCoooorrrreeee RRRReeeessssoooouuuurrrrcccceeee SSSSeeeetttt
  308.      NNNNaaaammmmeeee                            CCCCllllaaaassssssss                           TTTTyyyyppppeeee             DDDDeeeeffffaaaauuuulllltttt                AAAAcccccccceeeessssssss
  309.      ______________________________________________________________________________________________________________
  310.      XmNaccelerators                 XmCAccelerators                 XtAccelerators   dynamic                N/A
  311.      XmNancestorSensitive            XmCSensitive                    Boolean          dynamic                G
  312.      XmNbackground                   XmCBackground                   Pixel            dynamic                CSG
  313.      XmNbackgroundPixmap             XmCPixmap                       Pixmap           XmUNSPECIFIED_PIXMAP   CSG
  314.      XmNborderColor                  XmCBorderColor                  Pixel            XtDefaultForeground    CSG
  315.      XmNborderPixmap                 XmCPixmap                       Pixmap           XmUNSPECIFIED_PIXMAP   CSG
  316.      XmNborderWidth                  XmCBorderWidth                  Dimension        0                      CSG
  317.      XmNcolormap                     XmCColormap                     Colormap         dynamic                CG
  318.      XmNdepth                        XmCDepth                        int              dynamic                CG
  319.      XmNdestroyCallback              XmCCallback                     XtCallbackList   NULL                   C
  320.      XmNheight                       XmCHeight                       Dimension        dynamic                CSG
  321.      XmNinitialResourcesPersistent   XmCInitialResourcesPersistent   Boolean          True                   C
  322.  
  323.  
  324.  
  325.  
  326.  
  327.      Page 5                                         (printed 10/24/98)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.      SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))           UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV           SSSSggggSSSSpppprrrriiiinnnnggggBBBBooooxxxx((((3333XXXX))))
  335.  
  336.  
  337.  
  338.      XmNmappedWhenManaged            XmCMappedWhenManaged            Boolean          True                   CSG
  339.      XmNscreen                       XmCScreen                       Screen *         dynamic                CG
  340.      XmNsensitive                    XmCSensitive                    Boolean          True                   CSG
  341.      XmNtranslations                 XmCTranslations                 XtTranslations   dynamic                CSG
  342.      XmNwidth                        XmCWidth                        Dimension        dynamic                CSG
  343.      XmNx                            XmCPosition                     Position         0                      CSG
  344.      XmNy                            XmCPosition                     Position         0                      CSG
  345.  
  346.  
  347.         TTTTrrrraaaannnnssssllllaaaattttiiiioooonnnnssss
  348.           qSgSpringBox inherits translations from XmBulletinBoard.
  349.  
  350.      RRRREEEELLLLAAAATTTTEEEEDDDD IIIINNNNFFFFOOOORRRRMMMMAAAATTTTIIIIOOOONNNN
  351.           CCCCoooommmmppppoooossssiiiitttteeee((((3333XXXX)))), CCCCoooonnnnssssttttrrrraaaaiiiinnnntttt((((3333XXXX)))), CCCCoooorrrreeee((((3333XXXX)))),
  352.           XXXXmmmmBBBBuuuulllllllleeeettttiiiinnnnBBBBooooaaaarrrrdddd((((3333XXXX)))), SSSSggggCCCCrrrreeeeaaaatttteeeeGGGGrrrriiiidddd, SSSSggggCCCCrrrreeeeaaaatttteeeeGGGGrrrriiiiddddDDDDiiiiaaaalllloooogggg((((3333XXXX)))),
  353.           and XXXXmmmmMMMMaaaannnnaaaaggggeeeerrrr((((3333XXXX)))).
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.      Page 6                                         (printed 10/24/98)
  394.  
  395.  
  396.  
  397.